-- GENERATED SPELL FOR [Bleakheart Hellcaller] --


function spell0_3771(pUnit, Event) --@Summon Imp,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(11939,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_3771', 1, 1)
end

function spell1_3771(pUnit, Event) --@Summon Voidwalker,Self--
pUnit:FullCastSpellOnTarget(12746,pUnit)
pUnit:RegisterEvent('Sorts_3771', 610, 1)
end

function Sorts_3771(pUnit, Event)
local choix_sorts_3771 = math.random(0, 1)
if choix_sorts_3771 == 0 then
pUnit:RegisterEvent('spell0_3771', 1, 1)
end
if choix_sorts_3771 == 1 then
pUnit:RegisterEvent('spell1_3771', 1, 1)
end
end

function mob3771_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_3771', math.random(1500, 3000), 1)
end

function mob3771_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3771_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3771_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(3771, 1, 'mob3771_Action')
RegisterUnitEvent(3771, 2, 'mob3771_Leave')
RegisterUnitEvent(3771, 3, 'mob3771_Kill')
RegisterUnitEvent(3771, 4, 'mob3771_Die')
